/**
 * 
 */
package projeto.administrativo.checklist.cgd;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import plataforma.crudestatico.cgd.DaoBase;
import projeto.administrativo.checklist.cdp.KChecklist;
import projeto.administrativo.colaboradorexterno.cdp.ColaboradorExterno;

/**
 * @author mike
 *
 */
@Repository
public class DaoKChecklist extends DaoBase<KChecklist> {
	
	@Override
	public KChecklist recuperarPorId(Long id) {
		String hql = "select distinct kc from KChecklist kc "				
				+ " left outer join fetch kc.listaKItemChecklist"				
				+ " where kc.id=:parId";

		Query query = getEntityManager().createQuery(hql);
		query.setParameter("parId", id);

		return (KChecklist) query.getSingleResult();
	}


}
